package com.twu.biblioteca;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by csuarez on 10/02/14.
 */
public class Librarian {

    private List<User> users = new ArrayList<User>();
    private User currentUser;

    public boolean logInUser(String userID, String password) {

        for(User user : users ) {
            if(user.isValid(userID, password)) {
               currentUser = user;
               return true;

            }
        }
        return false;
    }

    public void addUser(User user) {
        users.add(user);
    }

    public User getCurrentUser() {
        return currentUser;
    }
}
